package com.kedacom.ctsp.authz.security.checker;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.support.MessageSourceAccessor;
import org.springframework.security.core.SpringSecurityMessageSource;
import org.springframework.security.core.userdetails.UserDetails;

/**
 * 默认的用户登录后者检查器
 *
 * @author xuwei
 * @create 2017-11-30 11:18
 **/
@Slf4j
public class DefaultPostAuthenticationChecks implements PostAuthenticationChecker {

    protected MessageSourceAccessor messages = SpringSecurityMessageSource.getAccessor();

    @Override
    public void check(UserDetails user) {
        // TODO
//        if (!user.isCredentialsNonExpired()) {
//            log.debug("User account credentials have expired");
//
//            throw new CredentialsExpiredException(messages.getMessage(
//                    "AbstractUserDetailsAuthenticationProvider.credentialsExpired",
//                    "User credentials have expired"));
//        }
    }
}
